﻿using System;


using Micronet.OpenWeb.Com.BLL;
using Micronet.OpenWeb.Com.Controls;

using Micronet.OpenWeb.Utils;

namespace Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.OpenPersonality
{
    public partial class LastNamesAdmin : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

          
        }

        protected void IsDeletedCb_CheckedChanged(object sender, EventArgs e)
        {

            var isDeletedCheckBox = (OwCheckBox)sender;
            var obj = OwLastNamesBLL.OwGetEntity(isDeletedCheckBox.Text.Trim().OwToInt64TryParse());

            obj.IsDeleted = isDeletedCheckBox.Checked.ToString().OwToBoolean();
            if (OwLastNamesBLL.OwSave(obj) > 0)
            {
                LastNamesGrid.Rebind();

            }

        }

    }
}